# -*- coding: utf-8 -*-

from service.handler.entry_handler import EntryHandler
from service.handler.login_handler import UserLoginHandler, CurrentUser
from service.handler.SUT_page_manage_handler import SUTPageManageHandler
from service.handler.SUT_page_element_manage_handler import SUTPageElementManageHandler
from service.handler.test_case_manage_handler import TestCaseManageHandler
from service.handler.test_case_classify_manage_handler import TestCaseClassifyManageHandler
from service.handler.test_step_manage_handler import TestStepManageHandler
from service.handler.config_manage_handler import ConfigManageHandler, KeywordManageHandler
from service.handler.test_set_manage_handler import TestSetManageHandler
from service.handler.tdp_executor_manage_handler import TdpSlaveGroupManageHandler
from service.handler.tdp_executor_manage_handler import TdpSlaveManageHandler
from service.handler.tdp_slave_handler import TdpSlaveWebsocketHandler
from service.handler.tdp_slave_handler import TdpSlaveHandler
from service.handler.test_plan_manage_handler import TestPlanManageHandler
from service.handler.test_job_manager_handler import TestJobManagerHandler
# from service.handler.test_trigger_Handler import CkEnvTestTriggerHandler
# from service.handler.test_trigger_Handler import ExtTrigger
from service.handler.file_handler import HtmlFileHandler
from tornado.web import StaticFileHandler
from service.config import static_path
# from service.handler.base_handler import BaseStaticFileHandler

from service.handler.test.slave_sec_websocket import SlaveSec, Token
from service.handler.test.interface_test import InterfaceTest


urls = [
    ("/static/(.*?\.html)$", HtmlFileHandler),
    (r'^/static/(.*?)$', StaticFileHandler, {"path": static_path}),
    ("/", EntryHandler),
    ("/user/login", UserLoginHandler),  # 用户登陆管理
    # ("/user/logout", UserLogoutHandler),  # 用户登出管理
    ("/user/currentUser/info", CurrentUser),  # 用户登陆登出管理
    ("/sut/page", SUTPageManageHandler),  # 被测系统 页面 管理
    ("/sut/page/element", SUTPageElementManageHandler),  # 被测系统页面 元素 管理
    ("/test/case", TestCaseManageHandler),  # 测试 用例 管理
    ("/test/case/classify", TestCaseClassifyManageHandler),  # 测试用例 分类 管理
    ("/test/step", TestStepManageHandler),  # 测试步骤管理
    ("/test/set", TestSetManageHandler),  # 测试用例 集 管理
    ("/test/plan", TestPlanManageHandler),  # 测试计划 管理
    ("/test/job", TestJobManagerHandler),  # 测试任务 管理

    ("/tdp/executor/group", TdpSlaveGroupManageHandler),  # 执行机 组 管理
    ("/tdp/executor", TdpSlaveManageHandler),  # 执行机 管理

    ("/tdp/slave/websocket", TdpSlaveWebsocketHandler),  # 执行机 websocket
    ("/tdp/slave", TdpSlaveHandler),  # 执行机

    ("/test/config", ConfigManageHandler),  # 配置管理
    ("/test/keyword", KeywordManageHandler),  # 关键字管理

    # ("/test/trigger/ck_env", CkEnvTestTriggerHandler),  # CRMjenkins触发CRM的cucumber测试脚本
    # ("/autotest/extrigger(.*)", ExtTrigger),  # 订单中心CI jenkins触发订单中心测试计划

    # ("/autotest/extrigger?c=jobResult", ExtTrigger),  # 外部查询任务状态

    # ---------- 测试使用 ----------
    ('/dtmp/websocket/autotest/slave', SlaveSec),
    ('/dtmp/getAppToken', Token),
    ('/tdp/interface/test', InterfaceTest),
]

